<h1>Listing instances</h1>

<table>
  <tr>
  <% for column in Instance.content_columns %>
    <th><%= column.human_name %></th>
  <% end %>
  </tr>
  
<% @instances.each do |i| %>
  <tr>

	<td><%= i.event.event_type.name %></td>
	<td><%= i.instance_type.name %></td>
    <td><%= link_to 'Show', :action => 'show', :id => i %></td>
    <td><%= link_to 'Edit', :action => 'edit', :id => i %></td>
    <td><%= link_to 'Destroy', { :action => 'destroy', :id => i }, :confirm => 'Are you sure?', :method => :post %></td>
  </tr>
<% end %>
</table>

<%= link_to 'Previous page', { :page => @instance_pages.current.previous } if @instance_pages.current.previous %>
<%= link_to 'Next page', { :page => @instance_pages.current.next } if @instance_pages.current.next %> 

<br />

<%= link_to 'New instance', :action => 'new' %>
